{include file="public/toper"/}
<style>
    .layui-unselect{width: 190px;}
    .layui-table {width: 70%;margin-left: 2%;}
    .layui-table  th ,.layui-table td { border: 0;}
    .layui-table td {padding-left: 70px;}
    .color{color: #FF0000;}
</style>
<div class="x-body">
    <table class="layui-table">
        <th class="">商品信息</th>
        <tr><td>订单编号:{$order.order_sn}</td><td>订单状态:<span class="color">
             {if condition = "$order.order_status  eq 0 "}未付款
            {elseif condition = "$order.order_status  eq 1 "/}已付款
            {elseif condition = "$order.order_status  eq 2 "/}已发货
            {elseif condition = "$order.order_status  eq 3 "/}已完成
            {elseif condition = "$order.order_status  eq 4 "/}已取消
            {elseif condition = "$order.order_status  eq 5 "/}归还中
            {elseif condition = "$order.order_status  eq 6 "/}店铺已收货
            {elseif condition = "$order.order_status  eq 7 "/}已验收
            {elseif condition = "$order.order_status  eq 8 "/}待用户确认
            {elseif condition = "$order.order_status  eq 9 "/}待用户支付
            {elseif condition = "$order.order_status eq 10 "/}租赁中
            {/if}
       【{$order.uname},<span id="sj">{$order.uphone}</span>】</span></td></tr>
        <tr>
            <td>商品信息：
                {volist name="$order['goods']" id="vo"}
                <p>{$vo.sname}    &nbsp;&nbsp;&nbsp;{if condition = "$vo.spec_item_key  neq '0'"}{$vo.spec_item_key}{/if}  &nbsp;&nbsp;&nbsp; *{$vo.goods_number}</p>
                {/volist}
            </td>
        </tr>

        <tr><td>共享期：<?php  echo floor(((strtotime(date('Y-m-d',$order['lease_end_time']))+86400)-strtotime(date('Y-m-d',$order['lease_time'])))/86400);?>天 &nbsp;&nbsp;&nbsp;【{$order['lease_time']|date="Y-m-d",###}到
            {$order['lease_end_time']|date="Y-m-d",###} 】</td></tr>
        <tr>

        <tr><td>日租：<span class="color">￥ {$order.sum_price}</span></td><td>支付押金：<span class="color">￥ {$order.deposit_price}</span></td></tr>
        <tr><td>实际支付金额：<span class="color">￥ {$order.pay_price}</span></td><td>邮费：<span class="color">￥ {$order.postage}</span></td></tr>
    </table>


    <table class="layui-table">
    <th class="">归还信息</th>
    <tr><td>归还方式: {if condition = "$order.return_type  eq 1 "}快递【{$order.store.name}  {$order.store.phone}  {$order.store.address}】 {else"/}自提【{$order.store.name}  {$order.store.phone}  {$order.store.address}】{/if}</td></tr>
    <tr><td>实际归还日期：{$order['lease_end_time']|date="Y-m-d",###}</td><td class="color">【逾期天数{$order.overdue_number}天】</td></tr>
    <tr><td>日租金：￥{$order['sum_price']}</td><td class="color">逾期费用￥{$order.overdue_price}</td></tr>
    <tr><td>减免天数：{$order['reduction_number']} </td><td class="color">减免费用￥{$order.jmfy}</td></tr>
    <tr><td>磨损说明：{$order['abrasion_explain']} </td></tr>

        {if condition = "$order.abrasion_img[0]  neq '0'"}
        <tr><td>磨损照片：</td></tr>
        <tr>
            <td>
                {volist name="$order.abrasion_img" key="key" id="vo"}
                    <img width="100" height="100" src="{$vo}" class="thumbs{$key}" thumb="{$vo}" />
                <script>
                    layui.use(['table'], function(){
                        var layer = layui.layer,$ = layui.jquery;

                        var layertips = null;
                        $(document).on('mouseenter','.thumbs'+{$key},function(){
                            //console.log(event);
                            var im = ('<img class="thumb-show" src="'+$(this).attr('thumb')+'" >');
                            var link = $(this).attr('href');
                            //layertip=layer.tips('<img style="" src='"/ >', this, { tips:[2,'#009688'] ,area: ['宽度', '高度'],time:false});
                            layertips = layer.tips( im, this, {
                                tips: [2,'#009688'],
                                skin: 'demo_class',
                                time: false,
                            });
                        });

                        //隐藏缩略图
                        $(document).on('mouseleave','.thumbs'+{$key}, function() {
                            layer.close(layertips);
                        });
                    });
                </script>
                {/volist}
            </td>
        </tr>
        {/if}
        <tr><td>磨损费用：<span class="color">￥{$order['abrasion_price']}</span></td></tr>
    </table>

    <table class="layui-table">
        <th>结算信息</th>
        <tr><td>现付押金：<span class="color">￥{$order.deposit_price}</span>,逾期/磨损费用：<span class="color">￥{$order.abrasion_price+$order.overdue_price-$order.jmfy}</span>

            {if condition = "$order.abrasion_price+$order.overdue_price-$order.jmfy  > $order.deposit_price"}
            还需支付:<span class="color">￥{$order.business_payment_pay}</span>
            {else"/}
            还需退还:<span class="color">￥{$order.refund_price}</span>
            {/if}
        </td></tr>
    </table>
    <table class="layui-table">
        <th>订单日志</th>
        <tr><td>日期</td><td>信息</td><td>操作人</td></tr>

        {volist name="$order.log" id="vo"}
        <tr><td>{$vo['create_time']|date="Y-m-d H:i:s",###}</td><td>{$vo.content}</td><td>{$vo.name}</td></tr>
        {/volist}
    </table>

</div>
{include file="public/footer"/}
<script>
    var phone = $('#sj').text();
    var nPhone = phone.substr(0, 3) + '****' + phone.substring(7, 11);
    $('#sj').text(nPhone);

    $("#sj").click(function(){
        var p = $('#sj').text();
        if(p.indexOf("***") >= 0 ) {
            $('#sj').text({$order['uphone']});
        }else {
            var nP = p.substr(0, 3) + '****' + p.substring(7, 11);
            $('#sj').text(nP);
        }
    });
</script>